home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKitArchive.mbox / mbox / 000226_misckit-reques…aska.et.byu.edu_Wed Jun 15 10:58:19 1994.msg < prev    next >
Internet Message Format  |  1994-10-30  |  6KB

  1. Return-Path: <misckit-request@alaska.et.byu.edu>
  2. Received: from alaska.et.byu.edu by darth.byu.edu (NX5.67d/NX3.0M)
  3.     id AA07187; Wed, 15 Jun 94 10:58:10 -0600
  4. Received: from darth.byu.edu by alaska.et.byu.edu; Wed, 15 Jun 1994 10:57:17 -0600
  5. Received: by darth.byu.edu (NX5.67d/NX3.0M)
  6.     id AA07174; Wed, 15 Jun 94 10:56:27 -0600
  7. Date: Wed, 15 Jun 94 10:56:27 -0600
  8. From: Don Yacktman <don@darth.byu.edu>
  9. Message-Id: <9406151656.AA07174@darth.byu.edu>
  10. Received: by NeXT.Mailer (1.100.RR)
  11. Received: by NeXT Mailer (1.100.RR)
  12. To: misckit@alaska.et.byu.edu
  13. Subject: FTPConnection
  14. Reply-To: don@darth.byu.edu
  15.  
  16.  
  17. This was posted to the misckit-request and looks like it was
  18. meant for misckit, so I am forwarding it for all to see...
  19.  
  20. Two comments from me:  (To be read after reading below.)
  21.  
  22. (1) "MiscFTPConnection" will become the name of the object as
  23. Georg suggests.
  24. (2) His comment on why he doesn't use MiscStrings is perfectly
  25. reasonable for the time being.  However, I hope to have a light
  26. weight string class at some point that could be used in situations
  27. like this.  It would rely upon the Object class and not much more;
  28. definitely free of the AppKit dependencies currently in MiscString.
  29. That should, in theory, solve the problem Georg mentions...
  30.  
  31. ---
  32. Later,
  33.  
  34. -Don Yacktman
  35. Don_Yacktman@byu.edu
  36.  
  37.  
  38. Begin forwarded message:
  39.  
  40. Date: Wed, 15 Jun 1994 11:14:27 +0200
  41. From: Georg Tuparev <tuparev@EMBL-Heidelberg.DE>
  42. Subject: FTPCommection
  43. To: misckit-request@byu.edu
  44. Reply-To: tuparev@EMBL-Heidelberg.DE
  45. Content-Transfer-Encoding: 7BIT
  46.  
  47. Hi MiscKiters,
  48.  
  49. That's the h-file for the "final" pre-alpha 0.1 version of my
  50. STFTPConnection class (the final name will be
  51. MiscFTPConnection, I presume). Thanks for all suggestions
  52. and/or comments. I cannot satisfy all the proposals, but I
  53. try to do my best...
  54.  
  55. J.B. Nicholson-Owens and others wrote:
  56. > - change all the (const char *) to MiscStrings or suitable
  57. > subclasses.
  58. The primary purpose of the class (at least within the
  59. SciTools project) is to to be used in daemons. I know how
  60. nice MiscXXXX classes are, but I have to keep the objects as
  61. small as possible. In the future (I hope in this century)
  62. I'll subclass STFTPConnection and add several user/programmer
  63. friendly methods.
  64.  
  65. I hope to submit this version before my vacation. Further
  66. suggestions and comments are welcome.
  67.  
  68. -- georg --
  69.  
  70. ========================================================================
  71. #import <appkit/appkit.h>
  72.  
  73. #define ST_FTP_OK 0              // No error found
  74. #define ST_FTP_CONF 1            // Connection failed
  75.  
  76. typedef struct st_f_time {       // Human readable time-stamp
  77.     unsigned int year;
  78.     unsigned short month;
  79.     unsigned short day;
  80.     unsigned short hours;
  81.     unsigned short minutes;
  82. } STFileTimestamp;
  83.  
  84. @interface STFTPConnection:Object
  85. {
  86. @private                         // All instance vars are privat!
  87.     id delegate;
  88.     int connection;
  89.     
  90.     char *ftpHost;
  91.     char *ftpUser;
  92.     char *ftpPasswd;
  93.     int errNumb;
  94. }
  95.  
  96. - init;
  97. - initToHost:(const char *)host;
  98. - initToHost:(const char *)host asUser:(const char *)name;
  99. - initToHost:(const char *)host asUser:(const char *)name    
  100.     withPassword:(const char *)passwd;
  101. - initAnonymousToHost:(const char *)host;
  102. - initAnonymousToHost:(const char *)host withPassword:(const char *)passwd;
  103.  
  104. - free;
  105.  
  106. - connect;
  107. - connectAndKeepConnected;
  108. - (BOOL)isConnected;
  109. - resumeConnection;
  110. - disconnect;
  111.  
  112. - setHost:(const char *)host;
  113. - (char *)host;
  114.  
  115. - setUser:(const char *)name;
  116. - (char *)user;
  117.  
  118. - setPassword:(const char *)passwd;
  119. - (char *)password;
  120.  
  121. - setBinaryOn:(BOOL)binaryOn;
  122. - (BOOL)isBinary;
  123.  
  124. - rootRemoteDir;                          // ... >cd /
  125. - changeRemoteDir:(const char *)dir;      // Full path
  126. - (char *)currentRemoteDir;
  127. - (char **)getRemoteSubDirs;
  128. - (char **)getRemoteFileNames;
  129.  
  130. - rootLocalDir;                          // ... >cd /
  131. - changeLocalDir:(const char *)dir;      // Full path
  132. - (char *)currentLocalDir;
  133. - (char **)getLocalSubDirs;
  134. - (char **)getLocalFileNames;
  135.  
  136. - getFile:(const char *)remoteFile;
  137. - getFile:(const char *)remoteFile :(const char *)localFile;
  138. - putFile:(const char *)localFile;
  139. - putFile:(const char *)localFile :(const char *)remoteFile;
  140. - getFiles:(const char **)remoteFiles;
  141. - putFiles:(const char **)localFile;
  142. - getAllFiles;
  143. - putAllFiles;
  144.  
  145. - useCompression:(BOOL)flag;
  146. - (BOOL)compression;
  147. - setCompressionType:(const char *)aType;                   // "Z" or "gz"
  148. - useDecompression:(BOOL)flag;
  149. - (BOOL)decompression;
  150.  
  151. - (unsigned long)sizeForLocalFile:(const char *)fName;
  152. - (STFileTimestamp *)timestampForLocalFile:(const char *)fName;
  153. - (time_t)unixTimestampForLocalFile:(const char *)fName;   // AU ... After Unix
  154. - (BOOL)isLocalCompressed:(const char *)localFile;         // .Z or .gz
  155. - (unsigned long)sizeForRemoteFile:(const char *)fName;
  156. - (STFileTimestamp *)timestampForRemoteFile:(const char *)fName;
  157. - (time_t)unixTimestampForRemoteFile:(const char *)fName;   // AU - After Unix
  158. - (BOOL)isRemoteCompressed:(const char *)remoteFile;        // .Z or .gz
  159.  
  160. - (int)errorNumb;
  161. - (char *)error;
  162.  
  163. - setDelegate:aDelegate;
  164. - delegate;
  165.  
  166. @end
  167.  
  168. @interface Object (STFTPConnectionDelegate)
  169. - ftpConnectionDidClose:sender;
  170. - ftpConnectionWillResume:sender;                           // Abort if nil
  171. - ftpConnectionDidResume:sender;
  172. - ftpConnection:sender willTransfer:(char *)fileName;       // Abort if nil
  173. - ftpConnection:sender didTransfer:(char *)fileName;
  174. @end
  175.  
  176. ========================================================================
  177.